package com.yfp.operation.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 客户抽奖剩余次数表
 * @TableName client_lottery_num
 */
@TableName(value ="client_lottery_num")
@Data
public class ClientLotteryNum implements Serializable {
    /**
     * id
     */
    @TableId
    private Long id;

    /**
     * 抽奖活动id
     */
    private Long lotteryRecordsId;

    /**
     * 客户id
     */
    private String clientId;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 剩余抽奖次数
     */
    private Integer lotteryNum;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ClientLotteryNum other = (ClientLotteryNum) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getLotteryRecordsId() == null ? other.getLotteryRecordsId() == null : this.getLotteryRecordsId().equals(other.getLotteryRecordsId()))
            && (this.getClientId() == null ? other.getClientId() == null : this.getClientId().equals(other.getClientId()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getLotteryNum() == null ? other.getLotteryNum() == null : this.getLotteryNum().equals(other.getLotteryNum()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getLotteryRecordsId() == null) ? 0 : getLotteryRecordsId().hashCode());
        result = prime * result + ((getClientId() == null) ? 0 : getClientId().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getLotteryNum() == null) ? 0 : getLotteryNum().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", lotteryRecordsId=").append(lotteryRecordsId);
        sb.append(", clientId=").append(clientId);
        sb.append(", createTime=").append(createTime);
        sb.append(", lotteryNum=").append(lotteryNum);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}